﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HCRS.Implementation;
namespace EZCRS.HCMS.DataAcl
{
    /// <summary>
    /// CommonPage 的摘要说明
    /// </summary>
    public class CommonPage : System.Web.UI.Page
    {
        public static string Javascript = "";
        public static string Title = "";
             
        public CommonPage()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
        }

        /// <summary>
        /// 集团ID
        /// </summary>
        /// 
        public int GID
        {
            get
            {
                return FGBRoleSystems.GroupID;
            }

        }

        /// <summary>
        /// 酒店ID
        /// </summary>
        public int HID
        {
            get
            {
                return FGBRoleSystems.HotelID;
            }

        }

        #region 带ID的链接参数
        /// <summary>
        /// 带ID的链接参数(wgid=##&amp;whid=##)
        /// </summary>
        public string IDUrlParams
        {
            get
            {
                return FGBRoleSystems.IDUrlParams;
            }
        }
        #endregion

        public string GetParams(string key)
        {
            try
            {
                string temp = this.Request.Params.Get(key);
                if (temp != null)
                {
                    return temp;
                }
                return "";
            }
            catch
            {
                return "";
            }
        }

        public string CSS
        {
            get
            {
                    return "@import  url(css/hubs1_dfb.css);";             
            }
        }
        public string memberCSS
        {
            get { return "@import  url(../css/hubs1_dfb.css);"; }
        }

        public string RateCode
        {
            get { return " (ratecode in('" + GetCrmfit(0).RateCode.Replace("|",",").Replace(",", "','").Replace(" ", "") + "'))"; ; }
        }

        public FGBGroup GetCrmfit(int languagetype)
        {
            FGBGroup fit = new FGBGroup();
            fit.gid = this.GID;
            fit.hid = this.HID;
            fit.languagetype = languagetype;
            fit = FGBRoleSystems.GetFGBEngine(fit);
            if (fit == null)
            {
                Response.Write("错误配置，请重新设置！");
                //Response.Write("<script>document.body.style.display=\"none\";</script>");
            }
            return fit;
        }
        /// <summary>
        /// 注册AjaxPro超时等事件
        /// </summary>
        public void AjaxRegist()
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "AjaxProtimeout", "<script>AjaxPro.timeoutPeriod = 60000;AjaxPro.onError = function(e){var le = document.getElementById(\"loadErrinfo\");le.style.display = e ? \"block\" : \"none\";}AjaxPro.onTimeout = function(t){var lt = document.getElementById(\"loadTimeoutinfo\");lt.style.display = t ? \"block\" : \"none\";}</script> ");
        }

    }

}